package appli;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.CharBuffer;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Dynamizer {

	private File simFile;

	private PrintWriter out;

	public Dynamizer(String path) {
		try {

			simFile = new File(path);
			out = new PrintWriter(new FileWriter(simFile, false));
			out.write("// C'est la classe!");
			out.println();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void append(String string) {

		try {
			out = new PrintWriter(new FileWriter(simFile, true));
		} catch (IOException e) {
			e.printStackTrace();
		}
		out.println();
		out.write(string);
		out.close();
	}

	public void parse() {
		InputStreamReader reader;
		// try {
		//
		// // CharBuffer target = new CharBuffer();
		//
		// ArrayList<String> elements = new ArrayList<String>();
		// // StringTokenizer st = new StringTokenizer(chaine, " ");
		// // while (st.hasMoreTokens()) {
		// // elements.add(st.nextToken());
		// // }
		//
		// } catch (FileNotFoundException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }

	}

}
